package me.samlss.lighter.shape;


import ohos.agp.render.Path;
import ohos.agp.utils.RectFloat;
/**
 * @author: zhu_zhonglin
 * @time: 2021/4/25
 */
public class CircleShape extends LighterShape {
    /**
     * Construct a circle shape object.
     * <p>
     * Will call {@link #CircleShape(float)} and pass the parameter is (15);
     */
    public CircleShape() {
        super(15);
    }

    /**
     * Construct a circle shape object.
     *
     * @param blurRadius
     */
    public CircleShape(float blurRadius) {
        super(blurRadius);
    }

    @Override
    public void setViewRect(RectFloat rect) {
        super.setViewRect(rect);

        if (!isViewRectEmpty()) {
            path.reset();
            path.addCircle(highlightedViewRect.getCenter().getPointX(), highlightedViewRect.getCenter().getPointY(),
                    Math.max(highlightedViewRect.getWidth(), highlightedViewRect.getHeight()) / 2, Path.Direction.CLOCK_WISE);
        }
    }
}
